using System;
using System.Collections.Generic;
using System.Text;
using CreamX.Framework.Game.Components;

namespace CreamX.Framework.Game
{
    public class Mount : ICloneable
    {
        public Mount()
        {
        }
        private MountPoint _mountPoint;

        public MountPoint MountPoint
        {
            get { return _mountPoint; }
            set { _mountPoint = value; }
        }
        private CreamXObject _object;

        public CreamXObject Object
        {
            get { return _object; }
            set { _object = value; }
        }
        private string _objectRef;

        public string ObjectRef
        {
            get { return _objectRef; }
            set { _objectRef = value; }
        }
        private bool _snapToMount=true;

        public bool SnapToMount
        {
            get { return _snapToMount; }
            set { _snapToMount = value; }
        }
        private bool _inheritVisibility;

        public bool InheritVisibility
        {
            get { return _inheritVisibility; }
            set { _inheritVisibility = value; }
        }


        public object Clone()
        {
            Mount mnt = new Mount();
            mnt.InheritVisibility = InheritVisibility;
            mnt.ObjectRef = ObjectRef;
            mnt.SnapToMount = SnapToMount;
            mnt.MountPoint = new MountPoint();
            if (MountPoint != null)
            {
                mnt.MountPoint.Name = MountPoint.Name;
                mnt.MountPoint.Position = MountPoint.Position;
                mnt.MountPoint.Rotation = MountPoint.Rotation;
            }
            mnt.Object = (CreamXObject)Object.Clone();
            
            return mnt;
        }
    }
}
